Event Constants
Sprite samples are QTAtomContainers with
kSpriteAtomType
child atoms at the root level. The new
kQTEventType
atom is inserted as a child of a
kSpriteAtomType
atom in order to create an event handler for the given sprite. All other atom types are inserted into a
kQTEventType
atom or one of its descendents. There is one exception: the
kQTEventFrameLoaded
atom is inserted as a sibling of the
kSpriteAtomType
atoms, since the frame loaded event is associated with the whole sprite sample, not with any particular sprite.
Constant descriptions
-
kQTEventType
-
This atom is a container for a single type of QuickTime event handler. For a given sprite, you add one atom of this type for each type of QuickTime event that you want it to handle. The ID of the
kQTEventType
atom specifies the type of QuickTime event. This atom's parent type is
kSpriteAtomType
.
-
All events are added to the sample using the
kQTEventType
atom, except for the frame loaded event.
-
kQTEventMouseClick
-
Event sent to a sprite when the mouse is pressed down over it. This sprite becomes the one that receives the
kQTEventMouseClickEnd
event when the mouse button is released. If the mouse is released over the sprite, it will also receive the
kQTEventMouseClickEndTriggerButton
event. You set the ID of a
kQTEventType
atom to
kQTEventMouseClick
to create a handler for it.
-
kQTEventMouseClickEnd
-
Event sent to the sprite that received the last
kQTEventMouseClick
event when the mouse button is released. This event is sent regardless of where the current mouse location is. You set the ID of a
kQTEventType
atom to
kQTEventMouseClickEnd
to create a handler for it.
-
kQTEventMouseClickEndTriggerButton
-
Event sent to the sprite that received the last
kQTEventMouseClick
event when the mouse button is released over the sprite. This event is sent in addition to the
kQTEventMouseClickEnd
event, not instead of it. You set the ID of a
kQTEventType
atom to
kQTEventMouseClickEndTriggerButton
to create a handler for it.
-
kQTEventMouseEnter
-
Event sent to a sprite when the mouse first enters it. This sprite becomes the one that will receive the
kQTEventMouseExit
event. This event is sent whether or not the mouse button is currently pressed. If two or more sprites overlap, the sprite in front receives the event. You set the ID of a
kQTEventType
atom to
kQTEventMouseEnter
to create a handler for it.
-
kQTEventMouseExit
-
Event sent to the sprite that received the last
kQTEventMouseEnter
event when the mouse is either no longer over it, or enters another sprite which is in front of it. This event is sent whether or not the mouse button is currently pressed. You set the ID of a
kQTEventType
atom to
kQTEventMouseExit
to create a handler for it.
-
kQTEventIdle
-
This event is sent to each sprite in a sprite track only if the sprite track has the sprite track property
kSpriteTrackPropertyQTIdleEventsFrequency
set to a value other than the default value which is
kNoQTIdleEvents
.
You set the ID of a
kQTEventType
atom to
kQTEventIdle
to create a handler for it.
-
kQTEventFrameLoaded
-
This event is sent to the sprite track when the current sprite track frame is loaded and contains a handler for this event. This event is not sent to a particular sprite; only one handler of this type may be present in a single sprite track frame. A typical use of this event would be to initialize sprite track variables.
-
Note that each frame can have its own handler. If the frame is a key frame, the scope of the handler is from the key frame until the next key frame unless the handler is overridden. If an override containing a handler for a particular event is followed by another override with no handler for that event, the key frame's handler for that event is once again used.
-
To create a handler for this type of event, you add an atom of type
kQTEventTypeFrameLoaded
to the sample as a sibling of the
kSpriteAtomType
atom with an ID of 1.
© 1999 Apple Computer, Inc.| Previous | Chapter Contents | Chapter Top | Next |